<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
selection_test(
    [
        '<div contenteditable id="target" style="padding: 20px;">',
            'abc',
            '<div>def</div>',
            '<div style="position:absolute; top:0px; right:0px;"></div>',
        '</div>',
    ],
    selection => {
        if (!window.eventSender)
            throw 'This test requires eventSender.';
        const target = selection.document.getElementById('target');
        eventSender.mouseMoveTo(selection.computeLeft(target) + 5,
                                selection.computeTop(target) + 5);
        eventSender.mouseDown();
        eventSender.mouseUp();
    },
    [
        '<div contenteditable id="target" style="padding: 20px;">',
            '|abc',
            '<div>def</div>',
            '<div style="position:absolute; top:0px; right:0px;"></div>',
        '</div>',
    ]);
</script>
